package py.com.fms.converter;

import java.io.Serializable;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;

import org.jboss.seam.Component;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.log.Log;

import py.com.fms.fms.bean.CurrencyBean;
import py.com.fms.session.WithinHolder;


@SuppressWarnings("unused")
@Name("checkConverter")
public class CheckConverter  implements Converter, Serializable  {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3885057532218245321L;
	@Logger
	private Log log;
	
	public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) {
		// TODO Auto-generated method stub
		if (arg2 != null) {
			try {
				Object object = (Object)arg2;
				return object;

			} catch (ConverterException e) {
				this.log.error(e);
			}
		}
		return null;
		
	}

	public String getAsString(FacesContext arg0, UIComponent arg1, Object arg2) {
		// TODO Auto-generated method stub
		if (arg2 != null) {
		     String string = arg2.toString();
		     return string;
		    }
		return null;
	}

}
